struct c_complex { double re, im; }; struct complex { double re, im; complex(double r, double i = 0.0) { re = r; im = i; } complex() { } /* uninitialized complex */ complex(c_complex z) { re = z.re; im = z.im; } /* init from denotation */ }; extern complex csqrt(complex), cexp(complex), expj(double); /* from complex.C */ extern complex evaluate(complex[], int, complex[], int, complex); /* from complex.C */ inline double hypot(complex z) { return ::hypot(z.im, z.re); } inline double atan2(complex z) { return ::atan2(z.im, z.re); } inline complex cconj(complex z) { z.im = -z.im; return z; } inline complex operator * (double a, complex z) { z.re *= a; z.im *= a; return z; } inline complex operator / (complex z, double a) { z.re /= a; z.im /= a; return z; } inline void operator /= (complex &z, double a) { z = z / a; } extern complex operator * (complex, complex); extern complex operator / (complex, complex); inline complex operator + (complex z1, complex z2) { z1.re += z2.re; z1.im += z2.im; return z1; } inline complex operator - (complex z1, complex z2) { z1.re -= z2.re; z1.im -= z2.im; return z1; } inline complex operator - (complex z) { return 0.0 - z; } inline bool operator == (complex z1, complex z2) { return (z1.re == z2.re) && (z1.im == z2.im); } inline complex sqr(complex z) { return z*z; }
file: /Techref/uk/ac/york/cs/www-users/http/~fisher/software/mkfilter/current/complex.h, 1KB, , updated: 2000/4/4 11:44, local time: 2024/5/18 22:22,
18.116.87.196:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://www.sxlist.com/techref/uk/ac/york/cs/www-users/http/~fisher/software/mkfilter/current/complex.h"> uk ac york cs www-users http ~fisher software mkfilter current complex</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.